﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IQKS.AWP.BusinessAccessLayer;
using IQKS.AWP.BusinessObject;
public partial class CandidateApprove : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            CandidateAllocateAssessorBAL objAllocateAssessorBAL = new CandidateAllocateAssessorBAL();
            CandidateAllocateAssessorBO objCandidateAllocateAssessorBO = new CandidateAllocateAssessorBO();
            objCandidateAllocateAssessorBO.CandidateID = Convert.ToInt64(CommonUtility.Decrypt( Convert.ToString(Request.QueryString["CandidateID"]),true));

            if (Convert.ToInt16(Request.QueryString["CandidateV"]) != null)
            {
                if (Convert.ToInt16(Request.QueryString["CandidateV"]) == 0)
                {
                    objCandidateAllocateAssessorBO.UserID = CommonUtility.GetLoggedOnUserId();
                    objCandidateAllocateAssessorBO.CandidateView = 0;
                }
                else if (Convert.ToInt16(Request.QueryString["CandidateV"]) == 1)
                {
                    objCandidateAllocateAssessorBO.UserID = new Guid();
                    objCandidateAllocateAssessorBO.CandidateView = 1;
                }
                else
                {
                    Response.Redirect("~/Login.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Login.aspx");
            }
            objCandidateAllocateAssessorBO.CandidateStatusID = Convert.ToInt32(CommonUtility.Decrypt(Convert.ToString(Request.QueryString["CandidateStatusID"]),true));
            tdAssessorStatus.InnerHtml = "<h3>" + objAllocateAssessorBAL.SetCandidateAllocatedToCandidate(objCandidateAllocateAssessorBO) + "</h3>";

        }
    }

    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Request.QueryString["CandidateV"].ToString() == "1")
        {
            Page.MasterPageFile = "~/MasterPages/OuterMaster.master";           
        }
    }

    protected void btnBack_Click(object sender, EventArgs e)
    {
        Response.Redirect("../home/CandidateStatus.aspx");
    }
}